#include <iostream>
#include <cstring>
using namespace std;

/*
	带参数列表的构造函数
*/

class Cat
{
public:
	Cat(string _name,int _age):name(_name),age(_age)  //name=_name  age=_age
	//带默认参数和参数列表形式混合
	//Cat(string _name="旺财",int _age=0):name(_name),age(_age)
	{
		cout<<"带参数列表的构造函数"<<endl;
	}
	
	void show()
	{
		cout<<"姓名: "<<name<<endl;
		cout<<"年龄: "<<age<<endl;
	}

private:
	int age;
	string name;
};


int main(int argc,char **argv)
{
	//创建猫的对象
	Cat c1("阿黄",5);
	
	c1.show();
	return 0;	
}